{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}


{% block title %}文章管理{% endblock %}



{% block page_content %}<div class="page-header">
    <h1>文章管理</h1>
</div>
<div class="col-md-12">

  <form class="form form-horizontal" role="form" action="{{ url_for('content.save_content') }}" method="post" >
    {{ form.csrf_token }}
    {{form.id}}
    <div class="form-group  required">
    <label class="control-label  col-lg-1" for="title">标题:</label>
    <div class=" col-lg-10 " style="text-align:right;">
    {{form.title(class="form-control",required=True)}}



    <div class="col-lg-offset-4
            col-lg-8
           " style="text-align:right;">

           {% for error in form.errors.title %}
                       <p class="help-block">{{ error }}</p>
           {% endfor %}

    </div>
     </div>
   </div>

   <div class="form-group  required">
   <label class="control-label  col-lg-1" for="catalog_id">目录:</label>
   <div class=" col-lg-3" style="text-align:right;">
   {{form.catalog_id(class="form-control")}}
    </div>
  </div>

   <div class="form-group  required">
  <label class="control-label  col-lg-1" for="body_text">内容:</label>

  <div class=" col-lg-11" style="text-align:right;">
  {{form.body_text(class='ckeditor')}}

  <div class="col-lg-offset-4
          col-lg-8
         " style="text-align:right;">

         {% for error in form.errors.body_text %}
                     <p class="help-block">{{ error }}</p>
         {% endfor %}

  </div>
   </div>
 </div>
 <div class="form-group">
 <div class="col-lg-offset-4
             col-lg-8
            " style="text-align:right;">


<a class="btn btn-success" href="{{ url_for('content.contents') }}">返回</a>

{{form.submit(class='btn btn-primary')}}

 </div>
 </div>

  </form>


</div>



<script type="text/javascript">
        CKEDITOR.replace(
            "body_text", {
                filebrowserUploadUrl: '/content/ckupload/'
                filebrowserImageUploadUrl :'/content/ckupload/'

            }
        );
    </script>
{% endblock %}



{% block scripts %}
{{ super() }}
{{ moment.include_moment() }}
        <script src="{{ url_for('static', filename='ckeditor/ckeditor.js') }}"></script>
{% endblock %}
